/**
 * 
 */
package br.com.lazyprogrammer.worldsoccermanager.network;

import java.util.HashMap;

import br.com.lazyprogrammer.worldsoccermanager.network.model.User;
import br.com.lazyprogrammer.worldsoccermanager.network.model.Stadium;
import br.com.lazyprogrammer.worldsoccermanager.network.model.Team;

/**
 * 
 * @author Limao Games <br />
 * <b>Email:</b> andreikeda@limaogames.com.br <br />
 * created on: 07/05/2014
 * @version 1.0
 * @see 
 */
public class URLParams {
	
	public URLParams() {
		
	}
	
	public HashMap<String, Object> buildCreateStadiumParams(Stadium stadium) {
		HashMap<String, Object> urlParams = new HashMap<String, Object>();
		urlParams.put(ParamConstants.METHOD, ValueConstants.CREATE);
		urlParams.put(ParamConstants.ID, stadium.getId());
		urlParams.put(ParamConstants.NAME, stadium.getName());
		urlParams.put(ParamConstants.CAPACITY, stadium.getCapacity());
		urlParams.put(ParamConstants.TICKET, stadium.getTicket());
		
		return urlParams;
	}
	
	public HashMap<String, Object> buildCreateTeamParams(User user, Team team) {
		HashMap<String, Object> urlParams = new HashMap<String, Object>();
		urlParams.put(ParamConstants.METHOD, ValueConstants.CREATE);
		urlParams.put(ParamConstants.ID, team.getId());
		urlParams.put(ParamConstants.NAME, team.getShortName());
		urlParams.put(ParamConstants.LONGNAME, team.getFullName());
		urlParams.put(ParamConstants.CASH, team.getCash());
		urlParams.put(ParamConstants.SUPPORTER, team.getSupporters());
		urlParams.put(ParamConstants.USER_ID, user.getId());
		urlParams.put(ParamConstants.STADIUM_ID, team.getStadium().getId());
		urlParams.put(ParamConstants.CREATED_ON, team.getCreatedOn());
        urlParams.put(ParamConstants.BACKGROUND, team.getBackground());
        urlParams.put(ParamConstants.FOREGROUND, team.getForeground());

        return urlParams;
	}
	
	public HashMap<String, Object> buildIsEmailAvailableParams(String email) {
		HashMap<String, Object> urlParams = new HashMap<String, Object>();
		urlParams.put(ParamConstants.METHOD, ValueConstants.IS_EMAIL_AVAILABLE);
		urlParams.put(ParamConstants.EMAIL, email);
		
		return urlParams;
	}
	
	public HashMap<String, Object> buildGetsPlayerParams(int page, int limit) {
		HashMap<String, Object> urlParams = new HashMap<String, Object>();
		urlParams.put(ParamConstants.METHOD, ValueConstants.GETS);
		urlParams.put(ParamConstants.PAGE, page);
		urlParams.put(ParamConstants.LIMIT, limit);
		
		return urlParams;
	}
	
	public HashMap<String, Object> buildGetsStaffParams(int page, int limit) {
		HashMap<String, Object> urlParams = new HashMap<String, Object>();
		urlParams.put(ParamConstants.METHOD, ValueConstants.GETS);
		urlParams.put(ParamConstants.PAGE, page);
		urlParams.put(ParamConstants.LIMIT, limit);
		
		return urlParams;
	}
	
	public HashMap<String, Object> buildGetsTacticsParams() {
		HashMap<String, Object> urlParams = new HashMap<String, Object>();
		urlParams.put(ParamConstants.METHOD, ValueConstants.GETS);
		
		return urlParams;
	}
	
	public HashMap<String, Object> buildGetTeamParams(String id) {
		HashMap<String, Object> urlParams = new HashMap<String, Object>();
		urlParams.put(ParamConstants.METHOD, ValueConstants.GET);
		urlParams.put(ParamConstants.ID, id);
		
		return urlParams;
	}
	
	public HashMap<String, Object> buildIsUsernameAvailableParams(String username) {
		HashMap<String, Object> urlParams = new HashMap<String, Object>();
		urlParams.put(ParamConstants.METHOD, ValueConstants.IS_USERNAME_AVAILABLE);
		urlParams.put(ParamConstants.USERNAME, username);
		
		return urlParams;
	}
	
	public HashMap<String, Object> buildLoginParams(String username, String password) {
		HashMap<String, Object> urlParams = new HashMap<String, Object>();
		urlParams.put(ParamConstants.METHOD, ValueConstants.LOGIN);
		urlParams.put(ParamConstants.PASSWORD, password);
		urlParams.put(ParamConstants.USERNAME, username);
		
		return urlParams;
	}
	
	public HashMap<String, Object> buildOnlineParams(String id) {
		HashMap<String, Object> urlParams = new HashMap<String, Object>();
		urlParams.put(ParamConstants.METHOD, ValueConstants.ONLINE);
		urlParams.put(ParamConstants.ID, id);
		
		return urlParams;
	}
	
	public HashMap<String, Object> buildOfflineParams(String id) {
		HashMap<String, Object> urlParams = new HashMap<String, Object>();
		urlParams.put(ParamConstants.METHOD, ValueConstants.OFFLINE);
		urlParams.put(ParamConstants.ID, id);
		
		return urlParams;
	}
	
	public HashMap<String, Object> buildRegisterParams(String id, String email, String username, String password, String description, String key, long registeredDate) {
		HashMap<String, Object> urlParams = new HashMap<String, Object>();
		urlParams.put(ParamConstants.METHOD, ValueConstants.REGISTER);
		urlParams.put(ParamConstants.DESCRIPTION, description);
		urlParams.put(ParamConstants.EMAIL, email);
		urlParams.put(ParamConstants.ID, id);
		urlParams.put(ParamConstants.KEY, key);
		urlParams.put(ParamConstants.PASSWORD, password);
		urlParams.put(ParamConstants.REGISTERED_DATE, registeredDate);
		urlParams.put(ParamConstants.USERNAME, username);
		
		return urlParams;
	}
	
	public HashMap<String, Object> buildValidateParams(String id, String key) {
		HashMap<String, Object> urlParams = new HashMap<String, Object>();
		urlParams.put(ParamConstants.METHOD, ValueConstants.VALIDATE);
		urlParams.put(ParamConstants.ID, id);
		urlParams.put(ParamConstants.KEY, key);
		
		return urlParams;
	}

}
